<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function pdf_create($orientacion,$html, $filename, $stream=true)
{
  require_once("dompdf/dompdf_config.inc.php"	);
  
  $dompdf = new DOMPDF();
  $dompdf->set_paper('legal', $orientacion); 
  $dompdf->load_html($html);
  $dompdf->render();
  if ($stream) {
      $dompdf->stream($filename.".pdf");
  } else {
      write_file("./temp/".$filename.".pdf", $dompdf->output());
  }
}